import { httpGet, httpPost, httpPut } from "../service/request";
import { DoctorListState } from "../views/consu/index";

export function getDoctorList(params: DoctorListState) {
  return httpGet("/health/user/inquiry/v1/findDoctorList", params);
}

// 咨询医生接口
export function consoltDoctor(doctorId: number) {
  return httpPut("/health/user/inquiry/verify/v1/consultDoctor", { doctorId });
}

// 查看当前咨询医生的接口
export function currentConsoltDoctor() {
  return httpGet("/health/user/inquiry/verify/v1/findCurrentInquiryRecord");
}

// inquiryId	int	问诊id	1
// content	string	文本内容，当发送的消息为字符内容时使用该参数，如果发送图片或者音视频，则无需传递	我是文本消息
// type	int	类型，请严格按照发送的类型指定该参数的值	1=文本，2=图片，3=语音
// doctorId	int	医生id	5

interface MessageParamState {
  inquiryId: number
  content: string
  type: number
  doctorId: number
}

export function sendMessage(data: MessageParamState) {
  return httpPost('/health/user/inquiry/verify/v1/pushMessage', data)
}

export function getChathistoryList(data:{ inquiryId: number, page: number, count: number } ) {
  return httpGet('/health/user/inquiry/verify/v1/findInquiryRecordList', data)
}